package com.yss.reportworld.domain.rule;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.annotation.ExcelValid;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import com.yss.common.core.utils.easyexecl.StringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据源配置_校验对象_入参(上下文)对象 rw_db_r_check_in_parameter
 *
 * @author yss
 * @date 2023-07-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rw_db_r_check_in_parameter")
public class RCheckInParameter extends Model<RCheckInParameter> {
    public static final String SHEET_NAME = "上下文入参";
    /**
     * ID
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    /**
     * 校验标识
     */
    @ExcelProperty({"上下文入参", "校验对象"})
    @TableField("CHECK_CODE")
    @ExcelValid(message = "【上下文入参】【上下文入参】【校验对象】不能为空")
    private String checkCode;

    /**
     * 参数code
     */
    @ExcelProperty({"上下文入参", "参数code"})
    @TableField("CODE")
    @ExcelValid(message = "【上下文入参】【上下文入】【参数code】不能为空")
    private String code;

    /**
     * 参数中文名
     */
    @ExcelProperty({"上下文入参", "参数中文名"})
    @TableField("NAME")
    @ExcelValid(message = "【上下文入参】【上下文入】【参数中文名】不能为空")
    private String name;

    /**
     * 参数类型（string,integer）
     */
    @ExcelProperty(value = {"上下文入参", "参数类型"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=字符串,1=整型数字,2=浮点型数字,3=日期,4=时间,5=日期+时间,6=对象,7=布尔,8=常量,9=引用表")
    @TableField("TYPES")
    @ExcelValid(message = "【上下文入参】【上下文入】【参数类型】不能为空")
    private Integer types;
    /**
     * 表达式
     */
    @ExcelProperty({"上下文入参", "表达式"})
    @TableField("EXPRESS")
    private String express;

    @ExcelProperty(value = {"多表关联-过滤条件", "操作符"}, converter = StringConverter.class)
    @EasyExcel(type = DBOperationEnum.class)
    @TableField("OPTIONS")
    private String options;

    @ExcelProperty({"多表关联-过滤条件", "默认值"})
    @TableField("DEFAULT_VAL")
    private String defaultVal;

    @ExcelProperty(value = {"多表关联-过滤条件", "放置位置"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=where之后,1=on之后")
    @TableField("CONDITION_TYPE")
    @ExcelValid(message = "【上下文入参】【多表关联-过滤条件】【放置位置】不能为空")
    private Integer conditionType;

    @ColumnWidth(16)
    @ExcelProperty({"多表关联-过滤条件", "子校验对象识别码"})
    @TableField("REF_CHECK_CODE")
    private String refCheckCode;

    @ColumnWidth(20)
    @ExcelProperty({"多表关联-过滤条件", "右引用校验对象识别码"})
    @TableField("RIGHT_CHECK_CODE")
    private String rightCheckCode;

    /**
     * 校验对象表ID_外键
     */
    @ExcelIgnore
    @TableField("CHECK_OBJECT_ID")
    private String checkObjectId;
    /**
     * 是否必传
     */
    @ExcelIgnore
    @TableField("REQUIRED")
    private Long required;

    /**
     * 是否主键
     */
    @ExcelIgnore
    @TableField("PK_FLAG")
    private Long pkFlag;

    /**
     * 是否常用
     */
    @ExcelIgnore
    @TableField("OFTEN_FLAG")
    private Long oftenFlag;

    /**
     * 参数表ID_外键
     */
    @ExcelIgnore
    @TableField("PARAMETER_ID")
    private String parameterId;

    /**
     * 常量表ID_外键
     */
    @ExcelIgnore
    @TableField("CONSTANT_ID")
    private String constantId;

    /**
     * 创建人
     */
    @ExcelIgnore
    @TableField("CREATE_USER")
    private String createUser;

    /**
     * 修改人
     */
    @ExcelIgnore
    @TableField("UPDATE_USER")
    private String updateUser;

    /**
     * 状态(逻辑删除状态)
     */
    @ExcelIgnore
    @TableField("STATUS")
    private Integer status;

    @ExcelIgnore
    @TableField("PARAMETER_TYPE_ID")
    private String parameterTypeId;

    @ExcelIgnore
    @TableField("CONSTANT_TYPE_ID")
    private String constantTypeId;

    @ExcelIgnore
    @TableField("REF_DESCRIBES")
    private String refDescribes;

    @ExcelIgnore
    @TableField("sort")
    private Integer SORT;

    @ExcelIgnore
    @TableField("RIGHT_CHECK_OBJECT_ID")
    private String rightCheckObjectId;

    /**
     * 数据编码
     */
    @ExcelIgnore
    @TableField("RW_DB_ID")
    private String rwDbId;
}
